<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>管理员列表-WeAdmin Frame型后台管理系统-WeAdmin 1.0</title>
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
		<link rel="stylesheet" href="../../static/css/font.css">
		<link rel="stylesheet" href="../../static/css/weadmin.css">
		<!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
		<!--[if lt IE 9]>
	      <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
	      <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
	    <![endif]-->

        <script src="../../lib/layui/layui.js" charset="utf-8"></script>
    	<script src="../../static/js/eleDel.js" type="text/javascript" charset="utf-8"></script>
	</head>

	<body>
		<div class="weadmin-nav">
			<span class="layui-breadcrumb">
        <a href="">首页</a>
        <a href="">管理员管理</a>
        <a>
          <cite>管理员列表</cite></a>
            </span>
        <a class="layui-btn layui-btn-sm" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
				<i class="layui-icon" style="line-height:30px">ဂ</i></a>
		</div>

        <div class="weadmin-body">


            <!--  表格搜索框-->
            <div class="demoTable">

                  <div class="layui-input-inline">
                    <input type="text" class="layui-input" id="startTime" placeholder="开始时间：yyyy-MM-dd">
                  </div>
                  <div class="layui-input-inline">
                    <input type="text" class="layui-input" id="endTime" placeholder="结束时间：yyyy-MM-dd">
                  </div>

                  <div class="layui-inline">
                    <input class="layui-input" name="id" id="tableReloadBtn" autocomplete="off" placeholder=" 搜索ID">
                  </div>
                  <button class="layui-btn" data-type="reload">搜索 <i class="layui-icon">&#xe615;</i></button>
            </div>
            <table class="layui-hide" id="tableUsers" lay-filter="tableUsers"></table>

        </div>
        <!--  body - end-->

        <!--  渲染table estart-->
             <script>
                layui.use('table', function(){
                  var table = layui.table;

                  <!-- ,url: '/demo/table/user/???' -->
                  //方法级渲染
                  table.render({
                    elem: '#tableUsers' //指向table的id
                    ,url: '../../json/test_1.json'
                    ,cols: [[
                      {checkbox: true, fixed: true}
                      ,{field:'userid', title: 'userid', width:80, sort: true, fixed: true}
                      ,{field:'username', title: '用户名', width:80}
                      ,{field:'password', title: '密码', width:80, sort: true}
                      ,{field:'user_remark', title: '用户备注', width:80}
                      ,{field:'user_email', title: '邮箱'}
                      ,{field:'user_level', title: '用户等级', sort: true, width:80}
                      ,{field:'create_time', title: '创建时间', sort: true, width:80}
                      ,{field:'session', title: '用户缓存', sort: true, width:135}
                    ]]
                    ,id: 'tableRenderReloadId' //给渲染制定一个id,共其他监听调用
                    ,page: true
                    ,height: 310
                  });

                  var $ = layui.$, active = {
                    reload: function(){
                      var tableReloadBtn = $('#tableReloadBtn'); //指向按钮的id

                      //执行重载
                      table.reload('tableRenderReloadId', { //指向render 自定义的id
                        page: {
                          curr: 1 //重新从第 1 页开始
                        }
                        ,where: {
                          key: {
                            id: tableReloadBtn.val() //指向按钮的id
                          }
                        }
                      }, 'data');
                    }
                  };

                  $('.demoTable .layui-btn').on('click', function(){ //指向table的class
                    var type = $(this).data('type');
                    active[type] ? active[type].call(this) : '';
                  });
                });
                </script>
    <!--x渲染日历 -->
        <script>
            layui.use('laydate', function () {
                var laydate = layui.laydate;
                laydate.render({
                    elem: '#startTime'
                })
                laydate.render({
                    elem: '#endTime'
                })

            })

        </script>


	</body>

</html>